import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Bar from '../views/Bar'
import Pie from "../views/Pie";
import Table from "../views/Table";
import Add from "../views/Add";
import Edit from "../views/Edit";

Vue.use(VueRouter)

const routes = [
    {
        path: '/home',
        component: Home
    },
    {
        path: '/bar',
        // component: 'Bar',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "about" */ '../views/Bar.vue')
    },
    {
        path: '/pie',
        component: Pie,
    },
    {
        path: '/table',
        component: Table
    },
    {
        path: '/edit',
        component: Edit
    },
    {
        path: '/add',
        component: Add
    }
]

const router = new VueRouter({
    mode: 'history',
    routes
})

export default router
